package com.chixing.day05_oop;

public class Bank {
    //初始化50个容量的Account数组 用于 保存账户信息
    private Account[] accountArr = new Account[50];
    private int size =0;// 已有账户的个数

    //开户 accType 0: 储蓄账户， 1： 信用账户
    public Account registAccount(String username,String userpassword,long telno,int accType){
        Account acc = null;

        if(accType == 0){
            acc = new SavingAccount(62222228919L,username,userpassword,telno,0,0);
        }else{ //accType == 1
            acc = new CreditAccount(62222228919L,username,userpassword,telno,0,1,10000,0);
        }

        accountArr[size++] = acc;
        return  acc;
    }
}
